﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
//using WFBASE;

namespace WF
{
    /// <summary>
    /// WFWC 的摘要描述
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // 若要允許使用 ASP.NET AJAX 從指令碼呼叫此 Web 服務，請取消註解下一行。
    // [System.Web.Script.Services.ScriptService]
    public class WFWC : System.Web.Services.WebService
    {
        //public WFENGINE.EngineEntry enty = new WFENGINE.EngineEntry();
        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
        [WebMethod]
        public string SignEntry(string SignXml)
        {
            //return enty.SignEntry(SignXml);
            return "";
        }
        [WebMethod]
        public string Class2JsonStr()
        {
            //WfForms wf = new WfForms();
            //wf.Processcode = "AH";
            //wf.Formsid = 101;
            //wf.Formname = "测试请假单";
            //return WFJson.GetJSON<WfForms>(wf);
            return "";
        }

        [WebMethod]
        public string GetUserFolders(string pid, string fnm)
        {
            BusWEB.WFInterface.Systems bws = new BusWEB.WFInterface.Systems();
            return bws.GetUserfolders(pid, fnm);
        }
        [WebMethod]
        public void ClassInsertByDLinQ()
        {
            //var dc = new WFBASE.Ewfpmdatacontexts("Data Source=test;User ID=ewfpm;Password=test")
            //{
            //    Log = Console.Out
            //};

            //var forms = from form in dc.WfForms
            //            select form;
            //foreach (var form in forms)
            //{
            //    Console.WriteLine("name: " + form.Formname);
            //}
            ////Console.ReadKey();
            ////dc.WfForms.Update(o => new WfForms { Formname = "New 內部聯絡函" }, o => o.Processcode == "FW");

            //var _forms = new WfForms { Formname = "TestProc", Processcode = "TestProc" };
            //dc.WfForms.InsertOnSubmit(_forms);
            //dc.SubmitChanges();
        }


    }
}
